extends Control

@onready var button = $Button
@onready var buttonSuccess = $ButtonSuccess


func _ready():
	Global.signalGameEnd.connect(onGameEnd)
	

func onGameEnd(success):
	display(success)


func _on_button_pressed():
	print("_on_button_pressed")
	Global.signalGameStart.emit()
	hide()


func display(success):
	if success:
		button.hide()
		buttonSuccess.show()
	else:
		button.show()
		buttonSuccess.hide()
	show()	
